using ASP;
using HoWave.Common;
using HoWave.Web;
using HoWave.Web.Admin;
using System;
using System.Web.Profile;
using System.Web.SessionState;
using System.Web.UI.WebControls;
public class HL_Admin_Admin_ShopPaymentType : Admin, IRequiresSessionState
{
	protected TextBox TextBox1;
	protected DropDownList DropDownList1;
	protected ObjectDataSource ObjectDataSource2;
	protected GridView GridView1;
	protected ObjectDataSource ObjectDataSource1;
	protected DefaultProfile Profile
	{
		get
		{
			return (DefaultProfile)this.Context.Profile;
		}
	}
	protected global_asax ApplicationInstance
	{
		get
		{
			return (global_asax)this.Context.ApplicationInstance;
		}
	}
	protected void Page_Load(object sender, EventArgs e)
	{
		if (!base.admin.CheckAdminPower(30))
		{
			base.WriteLog("View", Language.GetAdminMsg("Log/Access", "0"), "PaymentType");
			base.WriteRightErrMsg();
		}
	}
	protected void GridView1_DataBound(object sender, EventArgs e)
	{
		foreach (GridViewRow gridViewRow in this.GridView1.Rows)
		{
			int num = 100 * int.Parse(gridViewRow.Cells[2].Text);
			gridViewRow.Cells[2].Text = num.ToString() + "%";
		}
	}
	protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
	{
		if (e.Row.RowType == DataControlRowType.DataRow)
		{
			e.Row.Attributes.Add("onmouseover", "c=this.style.backgroundColor;this.style.backgroundColor='#E7EDFE'");
			e.Row.Attributes.Add("onmouseout", "this.style.backgroundColor=c;");
		}
	}
	protected void DeleteType_Button(object sender, CommandEventArgs e)
	{
		if (base.admin.CheckAdminPower(30))
		{
			int num = 0;
			int num2 = 0;
			try
			{
				num2 = int.Parse(e.CommandArgument.ToString());
				num = int.Parse(e.CommandName.ToString());
			}
			catch
			{
				this.WriteErrMsg("", Language.Get("Common/Fail"), "");
			}
			if (num != 0 && num2 != 0)
			{
				Shop_PayType shop_PayType = new Shop_PayType(this.conn);
				shop_PayType.DeleteType(num2, num);
				this.GridView1.DataBind();
			}
			else
			{
				this.WriteErrMsg("", Language.Get("Common/Fail"), "");
			}
		}
		else
		{
			base.WriteLog("Delete", Language.GetAdminMsg("Log/Access", "0"), "PaymentType");
			base.WriteRightErrMsg();
		}
	}
}
